<?php

/**
 * This is the model class for table "t_kppn".
 *
 * The followings are the available columns in table 't_kppn':
 * @property string $KDKPPN
 * @property string $TIPEKPPN
 * @property string $KDKTUA
 * @property string $KDKANWIL
 * @property string $KDDATIDUA
 * @property string $KDLOKASI
 * @property string $NMKPPN
 * @property string $ALMKPPN
 * @property string $TELKPPN
 * @property string $KOTAKPPN
 * @property string $KDDEFA
 * @property string $EMAIL
 * @property string $KDKCBI
 * @property string $KODEPOS
 * @property string $FAXKPPN
 * @property string $CEK
 */
class TKppn extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return TKppn the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 't_kppn';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('KDKPPN', 'length', 'max'=>3),
			array('TIPEKPPN, KDDEFA, KDKCBI, CEK', 'length', 'max'=>1),
			array('KDKTUA, KDKANWIL, KDDATIDUA, KDLOKASI', 'length', 'max'=>2),
			array('NMKPPN, ALMKPPN, KOTAKPPN, EMAIL', 'length', 'max'=>35),
			array('TELKPPN, FAXKPPN', 'length', 'max'=>70),
			array('KODEPOS', 'length', 'max'=>5),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('KDKPPN, TIPEKPPN, KDKTUA, KDKANWIL, KDDATIDUA, KDLOKASI, NMKPPN, ALMKPPN, TELKPPN, KOTAKPPN, KDDEFA, EMAIL, KDKCBI, KODEPOS, FAXKPPN, CEK', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'KDKPPN' => 'Kdkppn',
			'TIPEKPPN' => 'Tipekppn',
			'KDKTUA' => 'Kdktua',
			'KDKANWIL' => 'Kdkanwil',
			'KDDATIDUA' => 'Kddatidua',
			'KDLOKASI' => 'Kdlokasi',
			'NMKPPN' => 'Nmkppn',
			'ALMKPPN' => 'Almkppn',
			'TELKPPN' => 'Telkppn',
			'KOTAKPPN' => 'Kotakppn',
			'KDDEFA' => 'Kddefa',
			'EMAIL' => 'Email',
			'KDKCBI' => 'Kdkcbi',
			'KODEPOS' => 'Kodepos',
			'FAXKPPN' => 'Faxkppn',
			'CEK' => 'Cek',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('KDKPPN',$this->KDKPPN,true);
		$criteria->compare('TIPEKPPN',$this->TIPEKPPN,true);
		$criteria->compare('KDKTUA',$this->KDKTUA,true);
		$criteria->compare('KDKANWIL',$this->KDKANWIL,true);
		$criteria->compare('KDDATIDUA',$this->KDDATIDUA,true);
		$criteria->compare('KDLOKASI',$this->KDLOKASI,true);
		$criteria->compare('NMKPPN',$this->NMKPPN,true);
		$criteria->compare('ALMKPPN',$this->ALMKPPN,true);
		$criteria->compare('TELKPPN',$this->TELKPPN,true);
		$criteria->compare('KOTAKPPN',$this->KOTAKPPN,true);
		$criteria->compare('KDDEFA',$this->KDDEFA,true);
		$criteria->compare('EMAIL',$this->EMAIL,true);
		$criteria->compare('KDKCBI',$this->KDKCBI,true);
		$criteria->compare('KODEPOS',$this->KODEPOS,true);
		$criteria->compare('FAXKPPN',$this->FAXKPPN,true);
		$criteria->compare('CEK',$this->CEK,true);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}